home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright 1993, 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
- /*
- * Jump table definition macro's
- *
- * This file expects to be included before jmpsyms.h generated by somthing like
- *
- * grep JMPTAB_ENTRY *.f | sed 's/JMPTAB_DEFINE/JMPTAB_ENTRY/' > jmpsyms.h
- *
- * To make a jump table entry point do the following instead of placing
- * the symbol in the procedure etc.
- * JMPTAB_ENTRY(solve,_mips1,_mips2)
- *
- * Compile the file with
- * f77 -DMIPS2 -mips2 file.f -o mips2_file.o
- * and
- * f77 -DMIPS1 -mips1 file.f -o mips1_file.o
- *
- * cc -c jmptab_code.s
- * cc -c jmptab_switch.c
- *
- */
-
- #ifdef __ANSI_CPP__
-
-
- #ifdef MIPS2
- #define JMPTAB_DEFINE(symbol,suf1,suf2) symbol ## suf2
- #else
- #ifdef MIPS1
- #define JMPTAB_DEFINE(symbol,suf1,suf2) symbol ## suf1
- #else
- #define JMPTAB_DEFINE(symbol,suf1,suf2) symbol
- #endif
- #endif
-
- #ifdef JMPTAB_CODE
-
- #include <asm.h>
- #include <regdef.h>
-
- #define JMPTAB_ENTRY(symbol,suf1,suf2) \
- .globl symbol ## _addr; \
- .lcomm symbol ## _addr 4; \
- .text; \
- .ent symbol ## _,0; \
- .globl symbol ## _; \
- symbol ## _:; \
- lw t6, symbol ## _addr; \
- j t6; \
- .end symbol ## _
-
- #else
-
- #ifdef JMPTAB_EXTERNS
-
- #define JMPTAB_ENTRY(symbol,suf1,suf2) \
- extern int (* symbol ## _addr )(); \
- extern int symbol ## suf1 ## _ (); \
- extern int symbol ## suf2 ## _ (); \
-
- #else
-
- #ifdef JMPTAB_SETSUF1
-
- #define JMPTAB_ENTRY(symbol,suf1,suf2) \
- symbol ## _addr = symbol ## suf1 ## _;
-
- #else
-
- #ifdef JMPTAB_SETSUF2
-
- #define JMPTAB_ENTRY(symbol,suf1,suf2) \
- symbol ## _addr = symbol ## suf2 ## _;
-
- #endif /* JMPTAB_SETSUF2 */
- #endif /* JMPTAB_SETSUF1 */
- #endif /* JMPTAB_EXTERNS */
- #endif /* JMPTAB_CODE */
-
-
- #else /* __ANSI_CPP__ */
-
- #ifdef MIPS2
- #define JMPTAB_DEFINE(symbol,suf1,suf2) symbol/**/suf2
- #else
- #ifdef MIPS1
- #define JMPTAB_DEFINE(symbol,suf1,suf2) symbol/**/suf1
- #else
- #define JMPTAB_DEFINE(symbol,suf1,suf2) symbol
- #endif
- #endif
-
- #ifdef JMPTAB_CODE
-
- #include <asm.h>
- #include <regdef.h>
-
- #define JMPTAB_ENTRY(symbol,suf1,suf2) \
- .globl symbol/**/_addr; \
- .lcomm symbol/**/_addr 4; \
- .text; \
- .ent symbol/**/_,0; \
- .globl symbol/**/_; \
- symbol/**/_:; \
- lw t6, symbol/**/_addr; \
- j t6; \
- .end symbol/**/_
-
- #else
-
- #ifdef JMPTAB_EXTERNS
-
- #define JMPTAB_ENTRY(symbol,suf1,suf2) \
- extern int (* symbol/**/_addr )(); \
- extern int symbol/**/suf1/**/_ (); \
- extern int symbol/**/suf2/**/_ (); \
-
- #else
-
- #ifdef JMPTAB_SETSUF1
-
- #define JMPTAB_ENTRY(symbol,suf1,suf2) \
- symbol/**/_addr = symbol/**/suf1/**/_;
-
- #else
-
- #ifdef JMPTAB_SETSUF2
-
- #define JMPTAB_ENTRY(symbol,suf1,suf2) \
- symbol/**/_addr = symbol/**/suf2/**/_;
-
- #endif /* JMPTAB_SETSUF2 */
- #endif /* JMPTAB_SETSUF1 */
- #endif /* JMPTAB_EXTERNS */
- #endif /* JMPTAB_CODE */
- #endif /* __ANSI_CPP__ */
-
-
-